package edu.kit.los.event;


/**
 * @author Felix Kiechle, Benedikt Fuss  AIFB@BKIT
 * Hilfsklasse um FacebookJSON Objekte mithilfe der com.google.json library automatisch zu parsen. 
 */
public class FacebookEvent implements Event {

	private String name;
	private String description;
	private String start_time;
	private String end_time;
	@SuppressWarnings("unused")
	private String privacy;
	@SuppressWarnings("unused")
	private String updated_time;
	private String location;
	private String id;
	@SuppressWarnings("unused")
	private ownerClass owner;
	private geoClass venue;

	static class ownerClass{
		@SuppressWarnings("unused")
		private String name;
		@SuppressWarnings("unused")
		private String id;
		/**
		 * leerer Konstruktor wird für Json benötigt.
		 */
		public ownerClass(){
		}
	}
	@SuppressWarnings("unused")
	private ownerClass[] eventArray;
	
	static class geoClass{
		private double latitude;
		private double longitude;
		@SuppressWarnings("unused")
		private String id;
		/**
		 * leerer Konstruktor wird für gson benötigt
		 */
		public geoClass(){
		}
	}

	public String getId() {
		return id;
	}

	public String getTitle() {
		return name;
	}

	public String getDescription() {
		return description;
	}

	public String getVenueName() {
		return location;
	}

	public double getGeoLat() {
		if(venue == null){
			return 0;
		}
		return venue.latitude;
	}

	public double getGeoLong() {
		if(venue == null){
			return 0;
		}
		return venue.longitude;
	}

	public String getStartTime() {
		return start_time;
	}

	public String getStopTime() {
		return end_time;
	}

	public String getEventUrl() {
		return "http://www.facebook.com/events/" + getId();
	}

	public String getPublisher() {
		return "http://www.facebook.com";
	}
	public geoClass getVenue() {
		return venue;
	}

}
